package com.kingyea.app.market.versionInfo.service;

import com.kingyea.app.market.utils.page.PageInfo;
import com.kingyea.app.market.versionInfo.bean.VersionInfo;

import java.util.List;
import java.util.Map;

/**
 * @author
 * @version v1.0.0
 * @description VersionInfo 接口
 * @date Created in 2018-02-11 11:43:16
 */
public interface VersionInfoService {

    /**
     * 通过ID查找对象
     *
     * @param id
     * @return
     */
    VersionInfo getById(String id);

    /**
     * @Description: 获取app对应类型的当前版本，发布的版本理应一个
     * @param: [appCode, versionType]
     * @return: com.kingyea.app.market.versionInfo.bean.VersionInfo
     * @author: cxc
     * @Date: 2018/6/3
     */
    VersionInfo getCurrentVersionByAppCode(String appCode, Integer versionType);

    boolean updateToCurrentById(String id, String appCode, Integer versionType);

    /**
     * 列表
     *
     * @param versionInfo
     * @return
     */
    PageInfo<VersionInfo> list(Map<String, Object> versionInfo) throws Exception;

    /**
     * 删除
     *
     * @param id
     * @return
     */
    int deleteById(String id) throws Exception;

    /**
     * 添加
     *
     * @param versionInfo
     * @return
     */
    VersionInfo save(VersionInfo versionInfo) throws Exception;

    /**
     * 更新
     *
     * @param versionInfo
     * @return
     */
    VersionInfo update(VersionInfo versionInfo);


    List<VersionInfo> getListByVersionType(String versionType);

    Object versionList(Map<String, Object> appBaseInfo) throws Exception;

    /**
     * 删除该app所有版本信息
     */
    Object deletesByAppCode(String appCode) throws Exception;
}
